import flash.net.URLRequest;
import flash.net.navigateToURL;

import mx.core.FlexGlobals;

public const WEBAPP:String = "rianimazione/";

 public function getHostName():String  { 
	var g_HostString:String;
	var g_BaseURL:String = FlexGlobals.topLevelApplication.url; 
	var pattern1:RegExp = new RegExp("http://[^/]*/"); 
	if (pattern1.test(g_BaseURL) == true) { 
		g_HostString = pattern1.exec(g_BaseURL).toString(); 
	} else{ 
		g_HostString = "http://localhost/" 
	}   
	return g_HostString;
} 
  
public function openNewWindow(host:String,window:String):void {
	var u:URLRequest = new URLRequest(host+WEBAPP+window);
	navigateToURL(u,"_parent");
}